1. Field of the Invention
This invention relates to a controller for a multiphase motor, and in particular a controller for a multiphase stepper motor. Such motors are typically used for precise and repeatable angular rotations, for example, accurate machine positioning. Controlled angular positioning is accomplished by suitably adjusting the ratio of currents supplied to each phase winding of the motor.
2. Description of the Related Art
Multiphase motors are commonly used to precisely adjust the angular rotation of the motor shaft by applying appropriate currents to windings in the motor which have a fixed phase relation to each other. For example, a two phase motor may be constructed with two sets of windings about poles which are orthogonal to each other. Applying current to one set will force the poles on the motor shaft to align with the activated poles; subsequently switching the current to the other set will force the poles to align with this second set of poles, thereby forcing a 90 degree rotation of the shaft. Removing the current from the second set and applying an opposite current to the first set will force another 90 degree rotation, and so on. Each winding set is referred to as a phase winding, or merely a phase, of the motor. Each phase may comprise multiple poles within the motor, such that the rotation from one set of poles to another, the step angle, is a submultiple of the entire 360 degree rotation. For example, an eight pole motor has a step angle of 45 degrees, while a 16 pole motor has a step angle of 22.5 degrees. Traditionally, multiphase motors are designed to have two or three phases, although five phase motors are not uncommon. For ease of understanding, unless otherwise noted, a two phase motor will be assumed, but the principles of this invention are not intended to be limited to a two phase motor, as will be evident to one skilled in the art. Also, for ease of understanding, because stepper motors are the most common form of multiphase motors, the stepper motor will be presented for illustrative purposes herein, although the principles contained herein are applicable to alternative multiphase motors such as D.C. servo motors, A.C. synchronous motors, and the like.
Applying current to both phase windings of a two phase stepper motor will force the shaft to be located somewhere between the winding poles; for example, applying equal current to each winding pole in the above orthogonal pole example will result in a 45 degree rotation, as the shaft poles are equally attracted to each of the orthogonal poles. A microstepping motor allows for continuously variable currents to be applied to each winding set, thereby allowing the shaft to be rotated to the desired angular position between the fixed winding poles.
The ratio of the currents applied to each phase winding will determine the amount of rotation within a given step size. As noted above, applying equal currents will result in the location of the shaft to the midpoint between the poles. To effect the control of the current which is applied to a motor winding, a motor driver as shown in FIG. 1 may be utilized. In FIG. 1a, a motor driver 20 comprises an oscillator 120, a flip-flop 130, a voltage comparator 140, and a switch S1. The oscillator 120 is connected to a timing circuit TOSC, which is used to set the nominal frequency of the oscillator 120, so as to periodically set the flip-flop 130. The output 131 of the flip-flop 130 controls the switch S1. A motor M, having a winding 100, is connected in series between a voltage source 101 and the switch S1. A resistor R.sub.S 110 is connected in series between common ground and the switch S1. When the flip-flop is set, the switch S1 connects the motor M to the resistor R.sub.S, thereby allowing current to flow from the voltage source 101, through the motor M and resistor R.sub.S, to ground. When the flip-flop is reset, the switch S1 is opened, and current no longer flows through R.sub.S to ground. Being an inductive device, the current in the motor M cannot instantaneously go to zero; not shown are components which allow for inductive current to continue to flow/decay after switching, well known to those skilled in the art. For ease of understanding, unless otherwise noted, the currents referred to herein are the currents directly related to the supply source 101, and not those associated with residual, inductive currents.
The voltage across the resistor R.sub.S will be directly proportional to the current supplied to the motor M from voltage source 101, heretofore referred to as the winding current. The comparator 140 compares this voltage 111 to a control voltage VC. When the voltage 111 across the resistor R.sub.S equals the control voltage VC, the flip-flop 130 is reset, terminating the current flow. Optionally, the flip-flop 130 may also be fed back to the oscillator 120, to initiate an "off" time period; alternatively, the oscillator could be free running at a nominal frequency determined by TOSC. After a time period, determined by TOSC, the oscillator output 121 changes state and sets flip-flop 130, which closes switch S1, thereby providing current to the motor M again. Thus, by controlling the voltage VC, the current flow to the motor can be controlled.
Shown in FIG. 1b is a motor driver 10 having a second switch S2 to set the polarity of the current flowing through the motor M. Via signal P, the current to the winding can flow in either direction. Because stepper motors typically require polarity reversals, the circuit 10 shown in FIG. 1b is the more commonly used circuit for motor drivers.
Shown in FIG. 2 is the use of a pair of motor drivers 10a and 10b for a two phase stepper motor M comprising windings W.sub.A and W.sub.B. A controller 250 determines the polarity and magnitude of the current to be applied to each phase winding. The voltage level VC corresponding to the desired current magnitude is also determined, being the product of the desired current magnitude and the value of the current sensing resistor R.sub.S. The controller provides the input to each motor driver 10a and 10b as Pa, VC.sub.A and Pb, VC.sub.B, respectively. Each motor driver supplies the current to the winding by connecting each winding to ground, via resistors R.sub.SA and R.sub.SB, as discussed above, until the voltage across each resistor R.sub.SA and R.sub.SB equals VC.sub.A and VC.sub.B, respectively.
If both drivers operate independently, both windings may be switched on at the same time, and the source must be designed to accommodate supplying the cumulative current. If, on the other hand, the drivers are synchronized, such that they each supply current to their associated winding sequentially, the supply need only be designed to supply the maximum current required of each, rather than the cumulative current. Shown in FIG. 2 is a conventional means for synchronizing the operation of drivers 10a and 10b. An edge detector 210 determines when current is switched from winding W.sub.A. At this time of switching, the timing circuit T.sub.B which controls motor driver 10b is forced to a reset value by diode 220. By forcing a reset of the timing circuit T.sub.B at the time that current is switched from winding W.sub.A, current flows to winding W.sub.A after flowing in winding W.sub.A, in a sequential manner. Note that this synchronization requires sufficient current flowing to winding W.sub.A such that the edge detector 210 can detect the cessation of current. If the current flowing to winding W.sub.A is so slight as to preclude edge detection, both drivers will operate asynchronously. Because the intent of this synchronization is to preclude excessive supply current, an overlap of currents when the current flowing to winding W.sub.A is slight is not considered a problem.
The conventional synchronous motor control discussed above will be designed such that the sum of the on-times of both the windings is less than or equal to the overall cycle time. In this way, a long duration on-time to one winding will be offset by the corresponding short duration on-time of the other winding. Note that in the conventional synchronous motor control of FIG. 2, if the on-time of motor driver 10b is greater than the off-time of motor driver 10a, current will flow in both windings W.sub.A and W.sub.B simultaneously. Because it is assumed that this potential overlap period is slight, and that during this potential overlap period, the current in winding W.sub.A will be slight, this potential simultaneous current flow is not considered a problem.
As discussed above, the controller 250 sets the control voltages VC.sub.A and VC.sub.B as required so as to produce the appropriate currents in windings W.sub.A and W.sub.B. The association of these control voltages to the desired current is directly proportional to the value of the sensing resistors R.sub.SA and R.sub.SB. In determining the control voltages, the controller must use the nominal resistance values of the resistors; any inaccuracy in the resistor values will be reflected as an inaccuracy in the duration that the source current is applied, with a resultant inaccuracy in the position of the motor shaft. For this reason, the sense resistors used for motor drivers in high precision applications are typically specified with very tight tolerances, typically 1% or less. Often, pairs of resistors are hand sorted to provide for closely matched pairs. Note also that all of the motor current flows through the sense resistor, and therefore the sense resistors are also specified to be capable of handling high current flow. High power, tight tolerance resistors are costly, and subject to high thermal stress. Over time, the resistance values may change, and inaccuracies can be introduced; highly precise motor controllers often require initial calibration and subsequent recalibrations to minimize the inaccuracies associated with the sensing resistors.